package com;

import org.apache.ibatis.session.SqlSession;

public class TestDelete {
    public static void main(String[] args) {
        MyBatisSqlSessionFactory factory = new MyBatisSqlSessionFactory();
        SqlSession sqlSession = factory.getMyBatisSqlSessionFactory().openSession();
        TestDao testDao = sqlSession.getMapper(TestDao.class);
        System.out.println(testDao);

        int id = testDao.getDeleteCar(2);
        if(id==0){
            System.out.println("删除失败");
        }else {
            System.out.println("删除"+id+"行");
        }
        //一定要提交
        sqlSession.commit();
    }
}
